<template>
  <a-modal
    :width="800"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @ok="handleSubmit"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <a-descriptions :title="formInfo.title">
      <a-descriptions-item label="创建时间">{{ formInfo.createTime }}</a-descriptions-item>
      <a-descriptions-item label="所属科室">{{ formInfo.departmentId }}</a-descriptions-item>
      <a-descriptions-item label="使用科室">{{ formInfo.usingDepartmentId }}</a-descriptions-item>
      <a-descriptions-item label="管理部门">{{ formInfo.administrativeDept }}</a-descriptions-item>
      <a-descriptions-item label="当前位置">{{ formInfo.currentLocation }}</a-descriptions-item>
      <a-descriptions-item label="号码牌">{{ formInfo.plateNumber  }}</a-descriptions-item>
      <a-descriptions-item label="资产管理员">{{ formInfo.assetManager }}</a-descriptions-item>
      <a-descriptions-item label="使用人">{{ formInfo.userName }}</a-descriptions-item>
      <a-descriptions-item label="医疗器械分类目录">{{ formInfo.deviceClassificationid }}</a-descriptions-item>
      <a-descriptions-item label="计量器具">{{ formInfo.measurementInstrument }}</a-descriptions-item>
      <a-descriptions-item label="政府采购品目分类目录">{{ formInfo.politicalProcurementCatalogueId }}</a-descriptions-item>
      <a-descriptions-item label="部队医院通用名称目录">{{ formInfo.commonMilitaryNameId }}</a-descriptions-item>
      <a-descriptions-item label="固定资产等资产基础分类与代码">{{ formInfo.fixedClassificationId }}</a-descriptions-item>
      <a-descriptions-item label="高等学校固定资产分类与代码">{{ formInfo.fixedAssetClassificationCodeId }}</a-descriptions-item>
      <a-descriptions-item label="专业分类">{{ formInfo.professionalClassificationId }}</a-descriptions-item>
      <a-descriptions-item label="行业专业分类">{{ formInfo.industryProfessionalClassification }}</a-descriptions-item>
      <a-descriptions-item label="类型">{{ formInfo.deviceType }}</a-descriptions-item>
      <a-descriptions-item label="备案证号">{{ formInfo.certificateNumber }}</a-descriptions-item>
      <a-descriptions-item label="设备名称">{{ formInfo.deviceName }}</a-descriptions-item>
      <a-descriptions-item label="品牌">{{ formInfo.bind }}</a-descriptions-item>
      <a-descriptions-item label="型号">{{ formInfo.model }}</a-descriptions-item>
      <a-descriptions-item label="生产厂商">{{ formInfo.manufacturerName }}</a-descriptions-item>
      <a-descriptions-item label="序列号">{{ formInfo.serialNumber }}</a-descriptions-item>
      <a-descriptions-item label="生产日期">{{ formInfo.manufactureDate }}</a-descriptions-item>
      <a-descriptions-item label="批号">{{ formInfo.batchNumber }}</a-descriptions-item>
      <a-descriptions-item label="使用有效期(年)">{{ formInfo.useValidityPeriod }}</a-descriptions-item>
      <a-descriptions-item label="失效日期">{{ formInfo.expiringDate }}</a-descriptions-item>
      <a-descriptions-item label="通用名">{{ formInfo.commonName }}</a-descriptions-item>
      <a-descriptions-item label="标准品牌">{{ formInfo.labelBrand }}</a-descriptions-item>
      <a-descriptions-item label="标准型号">{{ formInfo.modelStandard }}</a-descriptions-item>
      <a-descriptions-item label="标准生产厂商">{{ formInfo.labelingAgency }}</a-descriptions-item>
      <a-descriptions-item label="原产国">{{ formInfo.countryOrigin }}</a-descriptions-item>
      <a-descriptions-item label="使用有效期(年)【标准】">{{ formInfo.standardUseValidityPeriod }}</a-descriptions-item>
      <a-descriptions-item label="备案证号【标准】">{{ formInfo.standardCertificateNumber }}</a-descriptions-item>
      <a-descriptions-item label="设备名称(原始)">{{ formInfo.primaryDeviceName }}</a-descriptions-item>
      <a-descriptions-item label="品牌(原始)">{{ formInfo.primaryBind }}</a-descriptions-item>
      <a-descriptions-item label="型号(原始)">{{ formInfo.primaryModel }}</a-descriptions-item>
      <a-descriptions-item label="生产厂商(原始)">{{ formInfo.manufacturer }}</a-descriptions-item>
      <a-descriptions-item label="安装日期">{{ formInfo.installDate }}</a-descriptions-item>
      <a-descriptions-item label="验收日期">{{ formInfo.acceptanceDate }}</a-descriptions-item>
      <a-descriptions-item label="启用日期">{{ formInfo.activationDate }}</a-descriptions-item>
      <a-descriptions-item label="备注">{{ formInfo.remark }}</a-descriptions-item>
      <a-descriptions-item label="保修状态">{{ formInfo.repairState }}</a-descriptions-item>
      <a-descriptions-item label="保修到期日期">{{ formInfo.warrantyExpirationDate }}</a-descriptions-item>
      <a-descriptions-item label="售后服务机构">{{ formInfo.afterSalesServiceOrganization }}</a-descriptions-item>
      <a-descriptions-item label="保修费用">{{ formInfo.warrantyCosts }}</a-descriptions-item>
      <a-descriptions-item label="售后电话">{{ formInfo.afterSalesPhone }}</a-descriptions-item>
      <a-descriptions-item label="工程师联系方式">{{ formInfo.engineerContactInformation }}</a-descriptions-item>
      <a-descriptions-item label="二维码图片">{{ formInfo.qrCodeImage }}</a-descriptions-item>
      <a-descriptions-item label="门牌">{{ formInfo.houseNumberImage }}</a-descriptions-item>
      <a-descriptions-item label="铭牌">{{ formInfo.nameplateImage }}</a-descriptions-item>
      <a-descriptions-item label="资产编码">{{ formInfo.assetCodeImage }}</a-descriptions-item>
      <a-descriptions-item label="器械证">{{ formInfo.instrumentCertificateImage }}</a-descriptions-item>
      <a-descriptions-item label="医疗器械UDI">{{ formInfo.udi }}</a-descriptions-item>
      <a-descriptions-item label="全景">{{ formInfo.panoramaImage }}</a-descriptions-item>
      <a-descriptions-item label="其他">{{ formInfo.otherImage }}</a-descriptions-item>
      <a-descriptions-item label="资产编码">{{ formInfo.assetCode }}</a-descriptions-item>
      <a-descriptions-item label="资产状态">{{ formInfo.assetStatus }}</a-descriptions-item>
      <a-descriptions-item label="固定资产">{{ formInfo.isFixedAssets }}</a-descriptions-item>
      <a-descriptions-item label="用途">{{ formInfo.purpose }}</a-descriptions-item>
      <a-descriptions-item label="资金来源">{{ formInfo.sourceFunds }}</a-descriptions-item>
      <a-descriptions-item label="采购日期">{{ formInfo.purchaseDate }}</a-descriptions-item>
      <a-descriptions-item label="入账日期">{{ formInfo.postingDate }}</a-descriptions-item>
      <a-descriptions-item label="国别">{{ formInfo.differentCountrie }}</a-descriptions-item>
      <a-descriptions-item label="是否国产">{{ formInfo.isDomesticallyProduced }}</a-descriptions-item>
      <a-descriptions-item label="总价(资产价值)">{{ formInfo.assetValue }}</a-descriptions-item>
      <a-descriptions-item label="数量">{{ formInfo.number }}</a-descriptions-item>
      <a-descriptions-item label="单价">{{ formInfo.unitPrice }}</a-descriptions-item>
      <a-descriptions-item label="供应商">{{ formInfo.assetSupplier }}</a-descriptions-item>
      <a-descriptions-item label="经办人">{{ formInfo.handledBy }}</a-descriptions-item>
      <a-descriptions-item label="折旧年限">{{ formInfo.periodDepreciation }}</a-descriptions-item>
      <a-descriptions-item label="残值率(%)">{{ formInfo.residualValueRate }}</a-descriptions-item>
      <a-descriptions-item label="净值(元)">{{ formInfo.netWorth }}</a-descriptions-item>
      <a-descriptions-item label="残值(元)">{{ formInfo.residualValue }}</a-descriptions-item>
    </a-descriptions>
  </a-modal>
</template>

<script>
  import pick from 'lodash.pick'
  import { getAction } from '@/api/manage'

  export default {
    name: 'DevArchiveEquipmentView',
    components: {},
    data () {
      return {
        visible: false,
        confirmLoading: false,
        formInfo: {},
        url: {
          saveInfo: '/system/devArchiveEquipment/save',
          getInfo: '/system/devArchiveEquipment/info'
        }
      }
    },
    created () {
    },
    methods: {
      show (record) {
        this.formInfo = Object.assign({}, record)
        if (this.formInfo.id) {
          getAction(this.url.getInfo, { 'id': record.id }).then(res => {
            this.$nextTick(() => {
              this.formInfo = (pick(res.result.data
        , 'id'
        , 'createTime'
        , 'departmentId'
        , 'usingDepartmentId'
        , 'administrativeDept'
        , 'currentLocation'
        , 'plateNumber '
        , 'assetManager'
        , 'userName'
        , 'deviceClassificationid'
        , 'measurementInstrument'
        , 'politicalProcurementCatalogueId'
        , 'commonMilitaryNameId'
        , 'fixedClassificationId'
        , 'fixedAssetClassificationCodeId'
        , 'professionalClassificationId'
        , 'industryProfessionalClassification'
        , 'deviceType'
        , 'certificateNumber'
        , 'deviceName'
        , 'bind'
        , 'model'
        , 'manufacturerName'
        , 'serialNumber'
        , 'manufactureDate'
        , 'batchNumber'
        , 'useValidityPeriod'
        , 'expiringDate'
        , 'commonName'
        , 'labelBrand'
        , 'modelStandard'
        , 'labelingAgency'
        , 'countryOrigin'
        , 'standardUseValidityPeriod'
        , 'standardCertificateNumber'
        , 'primaryDeviceName'
        , 'primaryBind'
        , 'primaryModel'
        , 'manufacturer'
        , 'installDate'
        , 'acceptanceDate'
        , 'activationDate'
        , 'remark'
        , 'repairState'
        , 'warrantyExpirationDate'
        , 'afterSalesServiceOrganization'
        , 'warrantyCosts'
        , 'afterSalesPhone'
        , 'engineerContactInformation'
        , 'qrCodeImage'
        , 'houseNumberImage'
        , 'nameplateImage'
        , 'assetCodeImage'
        , 'instrumentCertificateImage'
        , 'udi'
        , 'panoramaImage'
        , 'otherImage'
        , 'assetCode'
        , 'assetStatus'
        , 'isFixedAssets'
        , 'purpose'
        , 'sourceFunds'
        , 'purchaseDate'
        , 'postingDate'
        , 'differentCountrie'
        , 'isDomesticallyProduced'
        , 'assetValue'
        , 'number'
        , 'unitPrice'
        , 'assetSupplier'
        , 'handledBy'
        , 'periodDepreciation'
        , 'residualValueRate'
        , 'netWorth'
        , 'residualValue'
              ))
            })
          })
        }
        this.visible = true
      },
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              // 确定
      handleSubmit () {
        this.visible = false
      },
      // 关闭
      handleCancel () {
        this.close()
      },
      close () {
        this.visible = false
      }
    }
  }
</script>
